
import { utils } from "../utils/CommonUtil";
import EnumData from "../Enum/EnumData";
import CommonConstant from "../constant/CommonConstant";
import GameConfig from "../GameConfig";
import GameFacade from "../GameFacade";
export default class GameStart {
    private m_scene3D: Laya.Scene3D;

    private m_fui: fgui.GComponent;

    constructor() {
        GameFacade.Instance.Init();
        this.LoadLoadingRes();
    }
    /**
     * 预先加载 loading 界面资源
     */
    private LoadLoadingRes() {
        console.log("LoadLoadingRes");
        let self = this;
        Laya.loader.load(
            [
                //进入游戏之前先预加载需要的资源
                { url: CommonConstant._fuiLoadingPanelPath.image, type: Laya.Loader.IMAGE },
                { url: CommonConstant._fuiLoadingPanelPath.fui, type: Laya.Loader.BUFFER },
                { url: CommonConstant._fuiPropMessagePanelPath.fui, type: Laya.Loader.BUFFER },
                { url: CommonConstant._fuiCompositePanelPath.fui, type: Laya.Loader.BUFFER },
                { url: CommonConstant._fuiCompletePanelPath.fui, type: Laya.Loader.BUFFER },
                { url: CommonConstant._fuiSelectLevelPanelPath.fui, type: Laya.Loader.BUFFER },
                { url: CommonConstant._fuiHintPanelPath.fui, type: Laya.Loader.BUFFER },
            ],
            Laya.Handler.create(this, () => {
                fairygui.UIPackage.addPackage(CommonConstant._fuiLoadingPanelPath.Package);
                window.gameFacade.SceneMng.EnterMainScene(self.EnterMainSceneCallback.bind(self));
            }));
    }

    private EnterMainSceneCallback() {
        console.log("EnterMainScene complete");
    }
}